// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import axios from 'axios'

Vue.config.productionTip = false
Vue.prototype.axios = axios;



var whiteList=['Login', "Index"]
router.beforeEach((to,from,next)=>{
  //if(to.name == "Login" || sessionStorage.getItem("username"))
  if(whiteList.indexOf(to.name)>=0 || sessionStorage.getItem("uid"))
  {
    next();
  }
  else{
    next('/login');
  }
});



/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})
